﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace BizWeb.Core.Helpers
{
    public static class TextAbstractHelper
    {
        public static string TextAbstract(this HtmlHelper helper, string text, int maxLength)
        {
            // We'll use a differential of 5 characters.
            if (text.Length > maxLength - 5)
                return text.Substring(0, maxLength - 5) + " ...";
            else
                return text;
        }
    }
}